import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '@/views/Register'
import Personal from '../views/personal/index.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/login',
    name: 'LoginPage',
    component: Login
  },
  {
    path: '/register',
    name: 'RegisterPage',
    component: Register
  },
  {
    path: '/personal',
    name: 'Personalpage',
    component: Personal,
    meta: {
      needAuth: true
    }
  },
  {
    path: '/edit',
    name: 'editPage',
    component: () => import('../views/personal/edit.vue'),
    meta: {
      needAuth: true
    }
  },
  {
    path: '/follow',
    name: 'followPage',
    component: () => import('../views/personal/myFocus.vue'),
    meta: {
      needAuth: true
    }

  },
  {
    path: '/column',
    name: 'columnPage',
    component: () => import('../views/personal/columnNav.vue'),
    meta: {
      needAuth: true
    }
  },
  {
    path: '/collect',
    name: 'collectPage',
    component: () => import('../views/personal/myCollect.vue'),
    meta: {
      needAuth: true
    }
  },
  {
    path: '/postdetail',
    name: 'postDetailPage',
    component: () => import('../views/personal/postDetail.vue'),
    meta: {
      needAuth: true
    }
  },
  {
    path: '/search',
    name: 'searchPage',
    component: () => import('../views/Search.vue'),
  },
  {
    path: '/test',
    name: 'testPage',
    component: () => import('../views/Test.vue'),
    meta: {
      needAuth: true
    }
  },
  {
    path: '/morecomment',
    name: 'MoreCommentPage',
    component: () => import('../views/Morecomment.vue'),
    meta: {
      needAuth: true
    }
  },
  {
    path: '/mycomment',
    name: 'myCommentPage',
    component: () => import('../components/comment/myComment.vue'),
    meta: {
      needAuth: true
    }
  },

]

const router = new VueRouter({
  routes
})

export default router
